package com.cse587.gae.dto;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="countryList")
public class AccessibleCountryList {
	
	private CountryDto centralCountry;
	private CountryDto nearestCountry;
	private List<CountryDto> countryList;
	private int count;
	
	
	public AccessibleCountryList(){
		this.countryList = new ArrayList<CountryDto>();
	}
	
	public AccessibleCountryList(List<CountryDto> country) {
		super();
		this.countryList = country;
	}
	
	@XmlElement(name="countryLongTo")
	public CountryDto getCentralCountry() {
		return centralCountry;
	}

	public void setCentralCountry(CountryDto centralCountry) {
		this.centralCountry = centralCountry;
	}

	@XmlElement(name="nearestCountry")
	public CountryDto getNearestCountry() {
		return nearestCountry;
	}

	public void setNearestCountry(CountryDto nearestCountry) {
		this.nearestCountry = nearestCountry;
	}
	
	@XmlElement(name="country")
	public List<CountryDto> getCountryList() {
		return countryList;
	}

	public void setCountryList(List<CountryDto> country) {
		this.countryList = country;
	}

	public int getCount() {
		count = this.countryList.size(); 
		return count;
	}
	
	public void addToAccessibleCountryList(CountryDto dto){
		this.countryList.add(dto);
	}
}
